package com.sc.nft.feign;


import com.sc.nft.dto.IdRequest;
import com.sc.nft.req.points.*;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.points.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;

/**
 * @author JYT
 * @create 2024/4/27 11:29
 */
@FeignClient(name = "meta-mall-mini-app", path = "/wxMiniMall/points")
public interface WxMiniUserPointsClient {

    /**
     * 增加积分
     * @return
     */
    @PostMapping(value = "/addPoints", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<Boolean> addPoints(PointsReq req);


    /**
     * 解冻积分
     * @return
     */
    @PostMapping(value = "/thawPoints", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<Boolean> thawPoints(PointsReq req);

    /**
     * 减积分
     * @return
     */
    @PostMapping(value = "/subPoints", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<Boolean> subPoints(PointsReq req);

    /**
     * 用户剩余积分
     * @param request
     * @return
     */
    @PostMapping(value = "/user/get", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<webPointsGetVO> webGet(webPointsGetReq request);

    /**
     * 积分明细
     * @param request
     * @return
     */
    @PostMapping(value = "/user/records", produces = MediaType.APPLICATION_JSON_VALUE)
    PageResult<webPointsRecordsVO> records(webPointsGetReq request);

    /**
     * 积分统计
     * @return
     */
    @PostMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<PointsStatisticsVO> statistics();

    /**
     * 列表
     * @param pointsPageReq
     * @return
     */
    @PostMapping(value = "/adminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    PageResult<PointsPageVO> adminPage(PointsPageReq pointsPageReq);

    /**
     * 修改用户积分
     * @param request
     * @return
     */
    @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<Boolean> update(PointsUpdateReq request);

    /**
     * 积分变动记录
     * @param request
     * @return
     */
    @PostMapping(value = "/pointsRecords", produces = MediaType.APPLICATION_JSON_VALUE)
    PageResult<PointsRecordsPageVO> pointsRecords(webPointsGetRecordReq request);

    /**
     * 获取用户积分数量
     * @param idRequest
     * @return
     */
    @PostMapping(value = "/user/countNum", produces = MediaType.APPLICATION_JSON_VALUE)
    BigDecimal countNum(IdRequest idRequest);

    /**
     * 跑积分是否过期
     * @return
     */
    @PostMapping(value = "/pointsExpire", produces = MediaType.APPLICATION_JSON_VALUE)
    Result pointsExpire();


    /**
     * 初始化用户积分账户
     * @return
     */
    @PostMapping(value = "/initUserPoint", produces = MediaType.APPLICATION_JSON_VALUE)
    Boolean initUserPoint(InitUserPointsReq req);
}
